package com.jiashihui.schema_lgorithm.schema.chain;

/**
 * @author jiashihui
 * @describe: 处理者实现类
 * @date 2019/03/13
 */
public class HandlerImpl extends AbstractHandler implements Handler {

    /* 名称 */
    private String name;

    public HandlerImpl(String name) {
        this.name = name;
    }

    @Override
    public void handleRequest() {
        System.out.println(name + " deal!");
        Handler handler = getHandler();
        if (null != handler) {
            handler.handleRequest();
        }
    }
}
